/*这里面绘制折线图*/
function getOption(obj){
	/*
		待传入参数
		1.算法数组['FCFS','SSTF','SCAN','C-SCAN']
		2.时间数组
		3.磁道数组
	*/
	var option = {
	    title: {
	        text: '模拟效果显示'
	    },
	    tooltip: {
	        trigger: 'axis'
	    },
	    legend: {
	        data: obj.index
	    },
	    grid: {
	        left: '3%',
	        right: '4%',
	        bottom: '3%',
	        containLabel: true
	    },
	    toolbox: {
	        feature: {
	            saveAsImage: {}
	        }
	    },
	    xAxis: {
	        type: 'category',
	        boundaryGap: false,
	        data: obj.time
	    },
	    yAxis: {
	        type: 'value',
	        axisLabel: {
            	formatter: '{value}'
        	}
	    },
	    series: obj.members
	};
	return option;
}

/*
	绘制折线图对象
		index数组记录算法种类
			['FCFS','SSTF','SCAN','C-SCAN']
		members对象数组算法结果的数据结构
		 	{
	            name:'C-SCAN',
	            type:'line',
	            stack: '总量',
	            data:[320, 332, 301, 334, 390, 330, 320]
	        }
*/
var lineOpiton = {
	time : "",
	index : [],
	members : []
}

function getSingel(fn){
	var result ;
	return result || (result = fn.apply(this, arguments));
}

function getLineOption(){
	var obj = lineOpiton;
	return obj;
}

function createTime(num){
	var arr = new Array();
	for(var i=0; i<num; i++){
		arr.push((i+1));
	}
	return arr;
}